package com.sad.dao.impl;

import java.io.IOException;
import java.util.Map;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;

import com.sad.dao.BaseRecord;
import com.sad.model.Applyreturn;
import com.sad.model.JsonObject;
import com.sad.util.G;

public class ApplyreturnRecord extends BaseRecord<Applyreturn> {

	@Override
	protected String getUrl(Map<String, Object> parms) {
		String page = (String) parms.get(G.K.page);
		String pageSize = (String) parms.get(G.K.perPage);
		String url = G.system.url + "/toy/applyreturn/list?pageNo=" + page + "&pageSize="
				+ pageSize;

		return url;
	}

	@Override
	protected JsonObject<Applyreturn> parserJsonObject(String json) throws JsonParseException,
			JsonMappingException, IOException {
		ObjectMapper mapper = new ObjectMapper();
		return mapper.readValue(json, new TypeReference<JsonObject<Applyreturn>>() {
		});
	}

}
